import { EntityId, KfTreeNode, PageQueryParams } from 'kf-web-library';

export interface MaterialGroupPageQueryParams extends Partial<PageQueryParams> {
  searchText?: string;
  ids?: EntityId[]
  types?: string[];      //MaterialType 名称
}

export interface MaterialGroupTreeQueryParams {
  parentId?: EntityId; //上级组
  types?: string[]; //组类型
}

export interface MaterialGroup {
  deleted: number; //删除标记
  id: EntityId; //主键
  parentId: EntityId; //父主键
  name: string; //组名称
  type: string; //素材类型(图片、视频) MaterialType
  seq: number; //排序
  createTime: string; //创建时间
  createUserId: EntityId; //${column.comment}
  modifyTime: string; //修改时间
  modifyUserId: EntityId; //${column.comment}
  total: number; //总数
}


export interface MaterialGroup_Move {
  type?: string;
  fromGroupId: EntityId;
  toGroupId: EntityId;
}

export interface MaterialGroup_TreeNode extends MaterialGroup, Omit<KfTreeNode, 'name'> {
  id: EntityId;
  children?: MaterialGroup_TreeNode[];
}

export interface MaterialGroup_Create {
  parentId: EntityId; //父主键
  name: string; //组名称
  type: string; //素材类型(图片、视频) MaterialType
  seq: number; //排序
}

export interface MaterialGroup_Modify extends MaterialGroup_Create {
  id: EntityId;
}

export interface MaterialGroup_Patch extends Partial<MaterialGroup_Modify> {
  id: EntityId;
}
